<!--
 * @Author: zhangduo 445629906@qq.com
 * @Date: 2023-12-01 17:08:11
 * @LastEditors: zhangduo 445629906@qq.com
 * @LastEditTime: 2023-12-01 20:19:08
 * @FilePath: \mdyl-ui\src\views\system\test\index.vue
 * @Description: 测试页面
 * 
 * Copyright (c) 2023 by zhangduo, All Rights Reserved. 
-->
<template>
  <div>
    <el-table
      :data="features"
      v-loading="loading"
      stripes
      highlight-current-row
      :height="tableHeight"
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column
        label="objectid"
        align="center"
        prop="attributes.objectid"
        width="100"
      />
      <el-table-column
        label="名称"
        width="100"
        align="center"
        :show-overflow-tooltip="true"
        prop="attributes.objname"
      ></el-table-column>
      <el-table-column
        label="绿地大类"
        width="100"
        align="center"
        :show-overflow-tooltip="true"
        prop="attributes.type"
      >
        <!-- <template slot-scope="scope">
          <dict-tag
            :options="dict.type.sys_greenland_type"
            :value="scope.row.attributes.type"
          />
        </template> -->
      </el-table-column>
      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
      >
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            @click="handleView(scope.row, scope.index)"
            >详情</el-button
          >
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['datamanager:gusmm:edit']"
            >修改</el-button
          >
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['datamanager:gusmm:remove']"
            >删除</el-button
          >
          <el-button
            size="mini"
            type="text"
            icon="el-icon-location-outline"
            @click="handleLocate(scope.row, scope.index)"
            >定位</el-button
          >
        </template>
      </el-table-column>
    </el-table>
    <!-- <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      layout="total, sizes,prev, pager, next"
      @pagination="getList"
    /> -->
  </div>
</template>

<script>
import FeatureLayer from "@arcgis/core/layers/FeatureLayer";
export default {
  data() {
    return {
      total: 0,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 20,
        objname: undefined,
        objcode: undefined,
        type: undefined,
        type_m: undefined,
        type_s: undefined,
        suosjd: undefined,
        suossq: undefined,
        yhmcname: undefined,
        geometry: null,
      },
      features: [],
    };
  },
  mounted() {
    this.getDatalist();
  },
  methods: {
    async getDatalist() {
      let _self = this;
      const featureLayer = new FeatureLayer({
        url: window.mapConfig.operationLayers.featurelayers["gusmm"].url,
      });
      featureLayer.queryFeatures().then((featureSet) => {
        if (featureSet != undefined) _self.features = featureSet.features;
      });
      //   let featureSet = await featureLayer.queryFeatures();
      //   _self.features = featureSet.features;
    },
  },
};
</script>

<style lang="scss" scoped></style>
